package com.example.shinelon.gobang.dialog;

import android.app.DialogFragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

import com.example.shinelon.gobang.R;

/**
 * Created by DAB on 2016/4/15 09:46.
 */
public class MyDialog extends DialogFragment {
    public MyDialog() {
        super();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.dialog_test, null, false);
        view.setAnimation(anim());
        return view;
    }

    private Animation anim() {
//        AlphaAnimation animation=new AlphaAnimation(0,1);
        TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, 0, 0,
                Animation.RELATIVE_TO_SELF, -1f, Animation.RELATIVE_TO_SELF
                , 0);
        animation.setDuration(2000);

        return animation;
    }

    @Override
    public void onStart() {
        super.onStart();
    }


}
